<template>
  <div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="105px"
      label-position="left">
      <el-row type="flex" justify="center" align="middle" gutter="30">
        <el-col :span="12">
          <el-form-item label="账号" prop="account">
            <el-input v-model="formData.account" placeholder="请输入账号" show-word-limit clearable
              prefix-icon='el-icon-user' :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" justify="center" align="top" gutter="30">
        <el-col :span="12">
          <el-form-item label="密码" prop="pwd">
            <el-input v-model="formData.pwd" placeholder="请输入密码" clearable prefix-icon='el-icon-key'
              show-password :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" justify="center" align="top" gutter="15">
        <el-col :span="12">
          <el-form-item label-width="-2px" label="登录" prop="login">
            <el-button type="primary" icon="el-icon-search" size="medium"> 主要按钮 </el-button>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        account: '',
        pwd: undefined,
        login: '',
      },
      rules: {
        account: [{
          required: true,
          message: '请输入账号',
          trigger: 'blur'
        }],
        pwd: [{
          required: true,
          message: '请输入密码',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
